package com.starsoft.frame.core.orm;

import java.io.Serializable;
import java.util.List;
import java.util.Map;


public interface IBaseDao<T, PK extends Serializable> {

	public T get(PK id);
	
	public <B> B get(Class<B> entityClass,Serializable id);
	
	public List<T> getAll();
	
	public <B> List<B> getAll(Class<B> entityClass);
	
	public Serializable save(Object entity);
	
	public void update(Object entity);
	
	public void saveOrUpdate(Object entity);
	
	public void delete(Object entity);
	
	public <B> void delete(Class<B> entityClass, Serializable... id);
	
	public void initialize(Object entity);

	public List<T> findByMap(Map<String, Object> params);

	public <B> List<B> findByMap(Class<B> entityClass, Map<String, Object> params);
	
	public <B> List<B> find(String hql, Object... arg);

	public Map<String, Object> pageQuery(PageObject po);
}
